import {parseTime} from '../../utils'

// 电影排班
export default [
    {
        // 假设该天拍了三部电影
        url: '/mock/room-movie/getRoomMovieList',
        method: 'get',
        data: {
            code: 200,
            msg: "请求成功",
            data: [
                {
                    name: '斗破苍穹',
                    start: date2minute(new Date(2022, 8, 11, 0, 30, 0)),
                    end: date2minute(new Date(2022, 8, 11, 1, 0, 0)),
                    room: '朝阳一号'
                },
                {
                    name: '夏洛特烦恼',
                    start: date2minute(new Date(2022, 8, 11, 13, 30, 0)),
                    end: date2minute(new Date(2022, 8, 11, 15, 0, 0)),
                    room: '晓阳一号'
                },
                {
                    name: '名侦探柯南',
                    start: date2minute(new Date(2022, 8, 11, 22, 0, 0)),
                    end: date2minute(new Date(2022, 8, 11, 23, 30, 0)),
                    room: '朝露二号'
                }
            ]
        }
    }
]

function date2minute(date:Date):number {
   let timeArr:string[] | undefined = parseTime(date,'')!.split(' ')[1].split(':')
   let res:number = parseInt(timeArr[0], 10) * 60 + parseInt(timeArr[1], 10)
   return res
}